import java.util.ArrayList;

public class FormalParams {

	private ArrayList<FormalParam> formalParams;
	
	public FormalParams()
	{
		formalParams = new ArrayList<FormalParam>();
		
	}
	
	public void add(FormalParam fp){
		
		formalParams.add(fp);
		
	}
	
	public void merge(FormalParams fps){
		
		if(fps != null)
			for(FormalParam fp: fps.formalParams)
				formalParams.add(fp);
		
	}
	
	public String toString()
	{
		String result = "FromalParams \n";
		String tbr = "";
		
		for(FormalParam fp : formalParams)
		{
			tbr += "| "+fp.toString();
		}
		
		for( String s: tbr.split("\n"))
		{
			result += "| " +s + "\n";
		}
		return result;
				
	}

	public void check() throws SemanticException {
				
		for(FormalParam fp : formalParams){
			
			fp.check();
			
		}
		
	}

	public String[] getParamTypes() {
		
		String[] result = new String[formalParams.size()]; 
		
		for(int i = 0; i < formalParams.size(); i++){
			
			result[i] = ((FormalParam)formalParams.get(i)).getType();
			
		}
		
		return(result);
		
	}
	
}
